<template>
	<hr class="two" />
	<h2>====Hooks =>minx 提取公共方法到js文件 ===</h2>

	<h2>当前求和为：{{ sum }}</h2>
	<button @click="sum++">点我+1</button>
	<hr>
	<h2>当前点击时鼠标的坐标为：x：{{ point.x }}，y：{{ point.y }}</h2>
</template>

<script>
import {ref} from 'vue'

/*
* 可以公用
* */
import usePoint from './usePoint'

export default {
	name: 'Hooks',
	setup() {
		//数据
		let sum = ref(0)
		let point = usePoint()


		//返回一个对象（常用）
		return {sum, point}
	}
}
</script>

